# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=lxqt-admin
pkgver=1.1.0
pkgrel=0
pkgdesc="LXQt system administration tool"
url="https://github.com/lxqt/lxqt-admin"
# armhf: blocked by liblxqt and kwindowsystem
# s390x, riscv64: blocked by polkit-qt
arch="all !armhf !s390x !riscv64"
license="LGPL-2.0-or-later"
makedepends="
	cmake samurai lxqt-build-tools liblxqt-dev kwindowsystem-dev
	polkit-qt-1-dev qt5-qttools-dev
	"
options="!check" # No testsuite
subpackages="$pkgname-lang"
source="https://github.com/lxqt/lxqt-admin/releases/download/$pkgver/lxqt-admin-$pkgver.tar.xz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

lang() {
	install_if="lang $pkgname=$pkgver-r$pkgrel"
	amove usr/share/lxqt/translations/$pkgname-time
	amove usr/share/lxqt/translations/$pkgname-user
}

sha512sums="
f49e0c3e3b90f5b7fec2e304f45288c685447152bb80bdcf4bfdaa9051fd79ac557e363340e49c04dfe56a5454997d7f3b9488141056789fa2e22873ab1afa3c  lxqt-admin-1.1.0.tar.xz
"
